<?php
namespace app\common\model;

class WxAccountModel extends Model {

    /**
     * 返回微信信息
     * @param $where
     * @param array $field
     * @return array|mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function info($where, $field = ['id', 'original_id', 'app_id', 'secret', 'wechat_no']) {
        $wx = $this->field($field)->where($where)->where(['status' => self::STATUS_OK])->find();
        if (empty($wx)) {
            return [];
        }
        return $wx->getData();
    }
}